export const scanQRcode = () => {
  return new Promise((resolve, reject) => {
    uni.scanCode({
      success: (res) => {
        console.log('成功', res)
        resolve(res.result || '')
      },
      fail: (error) => {
        console.log('失败', error)
        reject(error)
      }
    })
  })
}
export const openPhoto = () => {
  return new Promise((resolve, reject) => {
    uni.chooseImage({
      success: (res) => {
        // 'data:image/jpeg;base64,'+ 
        // const base64 = uni.getFileSystemManager().readFileSync(res.tempFilePaths[0], 'base64')
        // console.log('成功', res, base64)
        // resolve(base64 || '')
        resolve(res.tempFilePaths[0] || '')
      },
      fail: (error) => {
        console.log('失败', error)
        reject(error)
      }
    })
  })
}